<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Basic PowerPC Built-in Functions Available on ISA 2.05 (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Basic PowerPC Built-in Functions Available on ISA 2.05 (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Basic PowerPC Built-in Functions Available on ISA 2.05 (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Basic-PowerPC-Built_002din-Functions.html" rel="up" title="Basic PowerPC Built-in Functions">
<link href="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06.html" rel="next" title="Basic PowerPC Built-in Functions Available on ISA 2.06">
<link href="Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations.html" rel="prev" title="Basic PowerPC Built-in Functions Available on all Configurations">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
kbd.key {font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="subsubsection-level-extent" id="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e05">
<div class="nav-panel">
<p>
Next: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06.html" accesskey="n" rel="next">Basic PowerPC Built-in Functions Available on ISA 2.06</a>, Previous: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations.html" accesskey="p" rel="prev">Basic PowerPC Built-in Functions Available on all Configurations</a>, Up: <a href="Basic-PowerPC-Built_002din-Functions.html" accesskey="u" rel="up">Basic PowerPC Built-in Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsubsection" id="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e05-1"><span>6.60.22.2 Basic PowerPC Built-in Functions Available on ISA 2.05<a class="copiable-link" href="#Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e05-1"> &para;</a></span></h4>

<p>The basic built-in functions described in this section are
available on the PowerPC family of processors starting with ISA 2.05
or later.  Unless specific options are explicitly disabled on the
command line, specifying option <samp class="option">-mcpu=power6</samp> has the effect of
enabling the <samp class="option">-mpowerpc64</samp>, <samp class="option">-mpowerpc-gpopt</samp>,
<samp class="option">-mpowerpc-gfxopt</samp>, <samp class="option">-mmfcrf</samp>, <samp class="option">-mpopcntb</samp>,
<samp class="option">-mfprnd</samp>, <samp class="option">-mcmpb</samp>, <samp class="option">-mhard-dfp</samp>, and
<samp class="option">-mrecip-precision</samp> options.  Specify the
<samp class="option">-maltivec</samp> option explicitly in
combination with the above options if desired.
</p>
<p>The following functions require option <samp class="option">-mcmpb</samp>.
</p><div class="example smallexample">
<pre class="example-preformatted">unsigned long long __builtin_cmpb (unsigned long long int, unsigned long long int);
unsigned int __builtin_cmpb (unsigned int, unsigned int);
</pre></div>

<p>The <code class="code">__builtin_cmpb</code> function
performs a byte-wise compare on the contents of its two arguments,
returning the result of the byte-wise comparison as the returned
value.  For each byte comparison, the corresponding byte of the return
value holds 0xff if the input bytes are equal and 0 if the input bytes
are not equal.  If either of the arguments to this built-in function
is wider than 32 bits, the function call expands into the form that
expects <code class="code">unsigned long long int</code> arguments
which is only available on 64-bit targets.
</p>
<p>The following built-in functions are available
when hardware decimal floating point
(<samp class="option">-mhard-dfp</samp>) is available:
</p><div class="example smallexample">
<pre class="example-preformatted">void __builtin_set_fpscr_drn(int);
_Decimal64 __builtin_ddedpd (int, _Decimal64);
_Decimal128 __builtin_ddedpdq (int, _Decimal128);
_Decimal64 __builtin_denbcd (int, _Decimal64);
_Decimal128 __builtin_denbcdq (int, _Decimal128);
_Decimal64 __builtin_diex (long long, _Decimal64);
_Decimal128 _builtin_diexq (long long, _Decimal128);
_Decimal64 __builtin_dscli (_Decimal64, int);
_Decimal128 __builtin_dscliq (_Decimal128, int);
_Decimal64 __builtin_dscri (_Decimal64, int);
_Decimal128 __builtin_dscriq (_Decimal128, int);
long long __builtin_dxex (_Decimal64);
long long __builtin_dxexq (_Decimal128);
_Decimal128 __builtin_pack_dec128 (unsigned long long, unsigned long long);
unsigned long long __builtin_unpack_dec128 (_Decimal128, int);

The <code class="code">__builtin_set_fpscr_drn</code> builtin allows changing the three decimal
floating point rounding mode bits.  The argument is a 3-bit value.  The
argument can either be a <code class="code">const int</code> or the value can be stored in
a variable.
The builtin uses the ISA 3.0 instruction <code class="code">mffscdrn</code> if available.
Otherwise the builtin reads the FPSCR, masks the current decimal rounding
mode bits out and OR's in the new value.

</pre></div>

<p>The following functions require <samp class="option">-mhard-float</samp>,
<samp class="option">-mpowerpc-gfxopt</samp>, and <samp class="option">-mpopcntb</samp> options.
</p>
<div class="example smallexample">
<pre class="example-preformatted">double __builtin_recipdiv (double, double);
float __builtin_recipdivf (float, float);
double __builtin_rsqrt (double);
float __builtin_rsqrtf (float);
</pre></div>

<p>The <code class="code">vec_rsqrt</code>, <code class="code">__builtin_rsqrt</code>, and
<code class="code">__builtin_rsqrtf</code> functions generate multiple instructions to
implement the reciprocal sqrt functionality using reciprocal sqrt
estimate instructions.
</p>
<p>The <code class="code">__builtin_recipdiv</code>, and <code class="code">__builtin_recipdivf</code>
functions generate multiple instructions to implement division using
the reciprocal estimate instructions.
</p>
<p>The following functions require <samp class="option">-mhard-float</samp> and
<samp class="option">-mmultiple</samp> options.
</p>
<p>The <code class="code">__builtin_unpack_longdouble</code> function takes a
<code class="code">long double</code> argument and a compile time constant of 0 or 1.  If
the constant is 0, the first <code class="code">double</code> within the
<code class="code">long double</code> is returned, otherwise the second <code class="code">double</code>
is returned.  The <code class="code">__builtin_unpack_longdouble</code> function is only
available if <code class="code">long double</code> uses the IBM extended double
representation.
</p>
<p>The <code class="code">__builtin_pack_longdouble</code> function takes two <code class="code">double</code>
arguments and returns a <code class="code">long double</code> value that combines the two
arguments.  The <code class="code">__builtin_pack_longdouble</code> function is only
available if <code class="code">long double</code> uses the IBM extended double
representation.
</p>
<p>The <code class="code">__builtin_unpack_ibm128</code> function takes a <code class="code">__ibm128</code>
argument and a compile time constant of 0 or 1.  If the constant is 0,
the first <code class="code">double</code> within the <code class="code">__ibm128</code> is returned,
otherwise the second <code class="code">double</code> is returned.
</p>
<p>The <code class="code">__builtin_pack_ibm128</code> function takes two <code class="code">double</code>
arguments and returns a <code class="code">__ibm128</code> value that combines the two
arguments.
</p>
<p>Additional built-in functions are available for the 64-bit PowerPC
family of processors, for efficient use of 128-bit floating point
(<code class="code">__float128</code>) values.
</p>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06.html">Basic PowerPC Built-in Functions Available on ISA 2.06</a>, Previous: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations.html">Basic PowerPC Built-in Functions Available on all Configurations</a>, Up: <a href="Basic-PowerPC-Built_002din-Functions.html">Basic PowerPC Built-in Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
